﻿/**********************************弘石项目*******************************************
* 功能描述:考勤 加班 出勤 假日
* 作者:石锦涛
* 时间:2021-12-14
* 
**********************************弘石项目*******************************************/
using HongStone.Domain.AttendanceManagement;
using HongStone.Domain.OperationsManagement;
using HongStone.Domain.SystemSetupModel.FrequentlyUsedDataModel;
using HongStone.Domain.SystemSetupModel.InstitutionSettingModel;
using HongStone.Dto;
using HongStone.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HongStone.Service
{
    public class CheckAttendanceBll
    {
        private readonly CheckAttendanceDal _checkAttendanceDal;
        public CheckAttendanceBll(CheckAttendanceDal checkAttendanceDal)
        {
            _checkAttendanceDal = checkAttendanceDal;
        }

        /// <summary>
        /// 部门加班补助显示
        /// </summary>
        /// <param name="nian"></param>
        /// <param name="yue"></param>
        /// <returns></returns>
        public List<ShowSubsidyDto> showSubsidy(int? bum, string nian, string yue)
        {
            try
            {

                return _checkAttendanceDal.showSubsidy( bum, nian, yue);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 部门显示
        /// </summary>
        /// <returns></returns>
        public List<Department> ShowOPLa()
        {
            try
            {
                return _checkAttendanceDal.ShowOPLa();
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 编辑修改补助
        /// </summary>
        /// <param name="subsidy"></param>
        /// <returns></returns>
        public int UpdateSubsidy(DepartmentSubsidy subsidy)
        {
            try
            {
                return _checkAttendanceDal.UpdateSubsidy(subsidy);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 部门经理加班补助显示
        /// </summary>
        /// <param name="nian"></param>
        /// <param name="yue"></param>
        /// <returns></returns>
        public List<ShowSubsidyDto> showJingliSubsidy(int? bum, string nian, string yue)
        {
            try
            {

                return _checkAttendanceDal.showJingliSubsidy(bum, nian, yue);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 显示添加经理页面
        /// </summary>
        /// <returns></returns>
        public List<ManagerMemberDto> showManager()
        {
            try
            {
                return _checkAttendanceDal.showManager();
            }
            catch (Exception)
            {

                throw;
            }
        }



        /// <summary>
        /// 查找人员
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pum"></param>
        /// <returns></returns>
        public List<ManagerMemberDto> AddManger(string name, int? pum)
        {
            try
            {
                return _checkAttendanceDal.AddManger(name, pum);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 承接部门
        /// </summary>
        /// <returns></returns>
        public List<ShowDepartmentDto> Showbumen()
        {
            try
            {
                return _checkAttendanceDal.Showbumen();
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 添加经理
        /// </summary>
        /// <param name="managerSet"></param>
        /// <returns></returns>
        public int PostAddManger(DepartmentManagerSet managerSet)
        {
            try
            {
                return _checkAttendanceDal.PostAddManger(managerSet);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 修改总经理
        /// </summary>
        /// <param name="managerZhong"></param>
        /// <returns></returns>
        public int PostZAddManger(DepartmentManagerZhong managerZhong)
        {
            try
            {
                return _checkAttendanceDal.PostZAddManger(managerZhong);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 删除经理
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Deletjinli(int id)
        {
            try
            {
                return _checkAttendanceDal.Deletjinli(id);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 删除总经理
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Deletzjinli(int id)
        {
            try
            {

                return _checkAttendanceDal.Deletzjinli(id);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 假日添加
        /// </summary>
        /// <param name="dayOff"></param>
        /// <returns></returns>
        public int AddDayOffA(DayOffTable dayOff)
        {
            try
            {
                return _checkAttendanceDal.AddDayOffA(dayOff);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 特殊假日添加
        /// </summary>
        /// <param name="dayOff"></param>
        /// <returns></returns>
        public int AddSpecialDayOffB(SpecialDayOffTable specialDay)
        {
            try
            {
                return _checkAttendanceDal.AddSpecialDayOffB(specialDay);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 假日 显示 查询
        /// </summary>
        /// <returns></returns>
        public List<TimeJiaDto> ShowDayOffA(int? timee)
        {
            try
            {
                return _checkAttendanceDal.ShowDayOffA(timee);

            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 特殊假日 显示 查询
        /// </summary>
        /// <returns></returns>
        public List<TimeJiaDto> ShowSpecialDayOffB(int? times)
        {
            try
            {
                return _checkAttendanceDal.ShowSpecialDayOffB(times);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 假日 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DateDayOffA(int id)
        {
            try
            {
                return _checkAttendanceDal.DateDayOffA(id);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 特殊假日 特殊工作日 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DateSpecialDayOffB(int id)
        {
            try
            {
                return _checkAttendanceDal.DateSpecialDayOffB(id);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 上班 时间
        /// </summary>
        /// <param name="year"></param>
        /// <param name="name"></param>
        /// <param name="pumen"></param>
        /// <returns></returns>
        public List<AttendanceMessageDto> ShowShangTime(int? year, string name, int? pumen)
        {
            try
            {
                return _checkAttendanceDal.ShowShangTime(year, name, pumen);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 下班 时间
        /// </summary>
        /// <param name="year"></param>
        /// <param name="name"></param>
        /// <param name="pumen"></param>
        /// <returns></returns>
        public List<AttendanceMessageDto> ShowXiaTime(int? year, string name, int? pumen)
        {
            try
            {
                return _checkAttendanceDal.ShowXiaTime(year, name, pumen);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 年假显示
        /// </summary>
        /// <param name="bum"></param>
        /// <param name="yearj"></param>
        /// <returns></returns>
        public List<AnnualLeaveDto> ShowAnnual(int? bum, int? yearj)
        {
            try
            {
                return _checkAttendanceDal.ShowAnnual(bum, yearj);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 年假设置 
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int HolidayTime(List<AnnualLeave> ids)
        {
            try
            {
                return _checkAttendanceDal.HolidayTime(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 导入 上传 Excel 特殊假日
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public int Uploading(List<SpecialDayOffTable> user)
        {
            return _checkAttendanceDal.Uploading(user);
        }

    }
}
